<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="bolao" />
    <g:set var="entityName" value="${message(code: 'user.label', default: 'User')}" />
    <title><g:message code="default.list.label" args="[entityName]" /></title>
  </head>
<body>
    <div class="body">
      <h1 class="title"><g:message code="default.list.label" args="[entityName]" /></h1>
      <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
      </g:if>
      <div class="list">
        <table class="table">
        <thead>
          <tr>
            <g:sortableColumn property="username" titleKey="user.username.label" />
            <g:sortableColumn property="firstname" titleKey="user.firstname.label" />
            <g:sortableColumn property="active" titleKey="user.active.label" />
            <g:sortableColumn property="email" titleKey="user.email.label" />
          </tr>
        </thead>
        <tbody>
        <g:each in="${users}" status="i" var="user">
          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
              <td><g:link action="show" id="${user.id}">${user.username?.encodeAsHTML()}</g:link></td>
              <td>${user.firstname?.encodeAsHTML()} ${user.surname?.encodeAsHTML()}</td>
              <td><g:formatBoolean boolean="${user?.active}" /></td>
              <td>${user.email?.encodeAsHTML()}</td>
          </tr>
        </g:each>
        </tbody>
        </table>
      </div>
    <div class="paginateButtons">
      <g:paginate total="${mz.matafe.bolao.User.count()}" />
    </div>
  </div>
</body>
</html>